#include "SimplePigFactory1.h"
#include "SimplePig.h"
#include "Scene.h"
#include "VerticalBouncing.h"

SimplePigFactory1::SimplePigFactory1(boost::shared_ptr<Scene> scene)
: m_scene(scene)
{
}

SimplePigFactory1::~SimplePigFactory1(void)
{
}

Entity* SimplePigFactory1::createEntity(const Vector3& position, const Dimension& size)
{
    return createEntity(position, size, position.y, 1.0f);
}

Entity* SimplePigFactory1::createEntity(const Vector3& position, const Dimension& size, 
                                        const float yMax, const float factor)
{
    // Create a textured entity
    TexturedEntity* newEntity = new SimplePig(m_scene, position, size);
    VerticalBouncing* behaviour = new VerticalBouncing(newEntity, position.y, yMax, factor);
    newEntity->attachBehaviour(behaviour);

    return newEntity;
}
